<?php

/**
 * dossier form base class.
 *
 * @method dossier getObject() Returns the current form's model object
 *
 * @package    forumCDE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasedossierForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'numero'                  => new sfWidgetFormInputText(),
      'service_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('service'), 'add_empty' => false)),
      'type_id'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('type'), 'add_empty' => false)),
      'formulairedef_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('formulairedef'), 'add_empty' => false)),
      'datedossier'             => new sfWidgetFormDate(),
      'demandeur_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('demandeur'), 'add_empty' => true)),
      'client_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('client'), 'add_empty' => true)),
      'codeclient'              => new sfWidgetFormInputText(),
      'nomclient'               => new sfWidgetFormInputText(),
      'prenomclient'            => new sfWidgetFormInputText(),
      'telclient'               => new sfWidgetFormInputText(),
      'mailclient'              => new sfWidgetFormInputText(),
      'participantsnotifier_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('participantsnotifier'), 'add_empty' => true)),
      'daterealsouhaitee'       => new sfWidgetFormDate(),
      'datereference'           => new sfWidgetFormDate(),
      'delaistandar'            => new sfWidgetFormInputText(),
      'ferme'                   => new sfWidgetFormInputCheckbox(),
      'fermetechnique'          => new sfWidgetFormInputCheckbox(),
      'typeexternalref'         => new sfWidgetFormInputText(),
      'desctypeexternal_id'     => new sfWidgetFormInputText(),
      'external_id'             => new sfWidgetFormInputText(),
      'datedernierrelance'      => new sfWidgetFormDate(),
      'brouillon'               => new sfWidgetFormInputCheckbox(),
      'enattente'               => new sfWidgetFormInputCheckbox(),
      'raisonattente'           => new sfWidgetFormInputText(),
      'deleted'                 => new sfWidgetFormInputCheckbox(),
      'urgent'                  => new sfWidgetFormInputCheckbox(),
      'justifurgence'           => new sfWidgetFormTextarea(),
      'datedebuttraitement'     => new sfWidgetFormDateTime(),
      'datefintraitement'       => new sfWidgetFormDateTime(),
      'datefermeture'           => new sfWidgetFormDate(),
      'datefermeturetechnique'  => new sfWidgetFormDate(),
      'duree'                   => new sfWidgetFormInputText(),
      'referencedemande'        => new sfWidgetFormInputText(),
      'created_at'              => new sfWidgetFormDateTime(),
      'updated_at'              => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'numero'                  => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'service_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('service'))),
      'type_id'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('type'))),
      'formulairedef_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('formulairedef'))),
      'datedossier'             => new sfValidatorDate(array('required' => false)),
      'demandeur_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('demandeur'), 'required' => false)),
      'client_id'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('client'), 'required' => false)),
      'codeclient'              => new sfValidatorString(array('max_length' => 60, 'required' => false)),
      'nomclient'               => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'prenomclient'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'telclient'               => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'mailclient'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'participantsnotifier_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('participantsnotifier'), 'required' => false)),
      'daterealsouhaitee'       => new sfValidatorDate(array('required' => false)),
      'datereference'           => new sfValidatorDate(array('required' => false)),
      'delaistandar'            => new sfValidatorInteger(array('required' => false)),
      'ferme'                   => new sfValidatorBoolean(array('required' => false)),
      'fermetechnique'          => new sfValidatorBoolean(array('required' => false)),
      'typeexternalref'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'desctypeexternal_id'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'external_id'             => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'datedernierrelance'      => new sfValidatorDate(array('required' => false)),
      'brouillon'               => new sfValidatorBoolean(array('required' => false)),
      'enattente'               => new sfValidatorBoolean(array('required' => false)),
      'raisonattente'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'deleted'                 => new sfValidatorBoolean(array('required' => false)),
      'urgent'                  => new sfValidatorBoolean(array('required' => false)),
      'justifurgence'           => new sfValidatorString(array('required' => false)),
      'datedebuttraitement'     => new sfValidatorDateTime(array('required' => false)),
      'datefintraitement'       => new sfValidatorDateTime(array('required' => false)),
      'datefermeture'           => new sfValidatorDate(array('required' => false)),
      'datefermeturetechnique'  => new sfValidatorDate(array('required' => false)),
      'duree'                   => new sfValidatorInteger(array('required' => false)),
      'referencedemande'        => new sfValidatorInteger(array('required' => false)),
      'created_at'              => new sfValidatorDateTime(),
      'updated_at'              => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('dossier[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'dossier';
  }

}
